package com.you.atlas.web.member.module.screen;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.you.atlas.biz.place.service.RateService;
import com.you.common.ibatis.data.DataList;
import com.you.member.biz.service.MemberQueryService;
import com.you.member.dal.dao.dataobject.MemberDO;

public class RateList {

    @Autowired
    private MemberQueryService memberQueryService;

    @Autowired
    private RateService        rateService;

    public void execute(@Param("pageNo") int pageNo, @Param("id") Long memberId, Context context,
                        Navigator navigator) {
        MemberDO memberDO = memberQueryService.find(memberId);
        if (memberDO == null) {
            navigator.redirectTo("memberModule").withTarget("error.vm");
            return;
        }
        context.put("memberDO", memberDO);
        DataList dataList = rateService.queryRatebyMemberId(pageNo, memberId);
        context.put("dataList", dataList);
    }
}
